package services;

import Dao.MemberDao;
import entity.MemberBean;

import java.math.BigDecimal;
import java.util.List;

public class MemberServices {
    private MemberDao memberDao = new MemberDao();
    //获取所有会员信息
    public List<MemberBean> getMemberAll(){return memberDao.getMemberAll();}
    //通过id获取会员信息
    public MemberBean getMemberId(int member_id){
        return memberDao.getMemberId(member_id);
    }
    //添加一个会员
    public int addMember(MemberBean member){
        return memberDao.addMember(member);
    }
    //修改会员信息
    public int updateMember(MemberBean member){
        return memberDao.updateMember(member);
    }
    //电话号码查询信息
    public MemberBean getMemberByPhone(String member_phone){
        return memberDao.getMemberByPhone(member_phone);
    }
    //续费
    public int renew(int renews,int member_id){
        return memberDao.renew(renews,member_id);
    }
    //拉黑
    public int delMember(int member_id,String member_state){
        return memberDao.delMember(member_id,member_state);
    }
    //重新设置该会员的余额
    public int conSumption(BigDecimal balance, BigDecimal consume, int member_id){ return  memberDao.conSumption(balance,consume,member_id); }
}
